package net.sparrow.gui.drawing.elements;

import net.sparrow.gui.drawing.SpScreenCoord;

public class SpElement {

	
	
	private boolean actionPerformed = false;
	
	//Actions//
	public void onMouseClick(SpScreenCoord coords, int leftOrRight) {}
	
	public void draw() {}
	
	public void onKeyTyped(char keyChar, int keyCode) {}
	///////////
	
	/**Use this to tell your host SpScreen
	 * that you just made an action!
	 */
	private void notifyActionPerformed() {
		actionPerformed = true;
	}
	
	/**Used by the SpScreen to see if it needs to handle an event by this element
	 * @return
	 */
	public boolean isActionWaiting() {
		return actionPerformed;
	}
	
	/**Called by SpScreen to confirm that the action has been handled,
	 * and doesn't need to be handled again.
	 */
	public void confirmActionHandled() {
		actionPerformed = false;
	}
}
